package osudi;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Main
{

	public static void main(String[] args)
	{
		String[] losovanaJmena = {"Mach", "Sebestova", "pani Kadrnozkova", "pes Jonatan",
				"pani Cibulkova", "kocka Micinka"};

		iOsudi osudi = new Osudi(losovanaJmena);
		System.out.println(osudi.getPocetOsobVosudi());
		System.out.println(osudi.losujSopakovanim());

		System.out.println(osudi.getPocetOsobVosudi());
		System.out.println(osudi.losujBezOpakovani());
		System.out.println(osudi.losujBezOpakovani());

		System.out.println(osudi.getPocetOsobVosudi());
	}

}

interface iOsudi
{
	String losujSopakovanim();

	String losujBezOpakovani();

	int getPocetOsobVosudi();
}

class Osudi implements iOsudi
{
	List<String> names = new ArrayList<String>();
	Random rnd = new Random();

	public Osudi(String[] losovanaJmena)
	{
		for (String s : losovanaJmena)
			names.add(s);
	}

	@Override
	public String losujSopakovanim()
	{
		return names.get(rnd.nextInt(names.size()));
	}

	@Override
	public String losujBezOpakovani()
	{
		String name = names.get(rnd.nextInt(names.size()));
		names.remove(name);
		return name;
	}

	@Override
	public int getPocetOsobVosudi()
	{
		return names.size();
	}

}